package Demo;

public class ThreadDemo3 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(){
            public void run(){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("1");
            }
        };
        t1.start();
        Thread.sleep(2000);
        System.out.println("2");
    }
}
